package com.huawei.appmarket.service.settings.card;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.settings.view.activity.OrderDownloadActivity;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import o.cgz;
import o.der.b;
import o.der.d;
import o.der.f;
import o.dge;
import o.dgh;
import o.Logger;
import o.egs;
import o.eqp;

public class SettingOrderDownloadCard extends BaseSettingCard implements OnClickListener {
    private String ˊ = UserSession.getInstance().getUserId();
    private String ˋ = eqp.ॱ();
    private TextView ˎ;
    private Context ॱ;

    public SettingOrderDownloadCard(Context context) {
        super(context);
        this.ॱ = context;
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        TextView textView = (TextView) view.findViewById(d.ʽʼ);
        TextView textView2 = (TextView) view.findViewById(d.ʽʻ);
        this.ˎ = (TextView) view.findViewById(d.ʽʽ);
        textView2.setVisibility(8);
        view.findViewById(d.ʿˊ).setMinimumHeight(this.ॱ.getResources().getDimensionPixelSize(b.ˊ));
        textView.setText(f.ˋˈ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        ˊ();
        this.ˊˋ.setOnClickListener(this);
    }

    public void onClick(View view) {
        dgh.onEvent(new dge.d(this.ᐝ, f.ʻˋ).ˏ("04" + HiAnalyticsConstant.REPORT_VAL_SEPARATOR + this.ˊ + HiAnalyticsConstant.REPORT_VAL_SEPARATOR + this.ˋ).ˋ());
        Intent intent = new Intent();
        intent.setClass(this.ॱ, OrderDownloadActivity.class);
        this.ॱ.startActivity(intent);
    }

    private void ˊ() {
        int ˏ = egs.ॱ().ˏ();
        switch (ˏ) {
            case 0:
                this.ˎ.setText(f.ˋˑ);
                return;
            case 1:
                this.ˎ.setText(f.ˋᐨ);
                return;
            case 2:
                this.ˎ.setText(f.ˋᐧ);
                return;
            default:
                Logger.ˋ("SettingOrderDownloadCard", "Invalid mobile data download status:" + ˏ);
                this.ˎ.setText(f.ˋᐨ);
                return;
        }
    }
}
